package com.els.pages.fallBack;

import com.els.pages.service.FeignClientService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @title: FeignServiceFallback
 * @projectName fake-baidu
 * @Date: 2021/7/1 20:22
 * @Author: lei.yu-esint
 * @Description:
 */
@Component
public class FeignServiceFallback implements FallbackFactory<FeignClientService> {

    @Override
    public FeignClientService create(Throwable throwable){

        //降级回调本地方法
        return new FeignClientService() {
            @Override
            public String getIndexPushNews(String pages, String size) {
                return null;
            }

            @Override
            public String getIndexKeywords(String keyword,String page,String size) {
                return null;
            }
        };

    }

}
